package com.tboss.am.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.tboss.am.service.AMService;

@Controller
@RequestMapping(value = "/am")
public class AMController {
	
	@Autowired private AMService service;
	
	@RequestMapping(value = "/main", method = {RequestMethod.GET, RequestMethod.POST})
	public String home(Model model, HttpServletRequest req) {
		
		String rtnUrl = req.getServletPath().substring(1);
		System.out.println(rtnUrl);
		return rtnUrl+"Ajax";
	}
	
	@RequestMapping(value = "/test", method = {RequestMethod.GET, RequestMethod.POST})
	public void getTest(@RequestParam("testStr") String testStr, HttpServletRequest request) {
		
		System.out.println("-------- str: "+testStr);
		
		
		
	}

}
